package top.doe.spark.netty

import top.doe.spark.rpc.{RpcEnv, RpcEnvConfig, RpcEnvFactory}

class NettyRpcEnvFactory extends RpcEnvFactory{

  override def create(config: RpcEnvConfig): RpcEnv = {
    //创建对于的NettyRpcEnv实现
    val nettyEnv = new NettyRpcEnv(config.numUsableCores)
    nettyEnv.startServer(config.bindAddress, config.port)
    nettyEnv
  }
}
